package cn.zhukelili.base;

import cn.zhukelili.base.Expression;
import cn.zhukelili.base.SymbolExpression;

import java.util.HashMap;

/**
 * @description: 减法解析器
 * @author: hhbeast
 * @since: 2018/7/28 10:08
 */
public class SubExpression extends SymbolExpression {
    public SubExpression(Expression _left, Expression _right) {
        super(_left, _right);
    }

    //左右两个表达式相减
    public int interpreter(HashMap<String, Integer> var) {
        return super.left.interpreter(var) - super.right.interpreter(var);
    }
}
